﻿@using CashFlow.Db.Entity;
@{
    ViewBag.Title = "ShopPerformance";
    Layout = "~/Areas/ShopManage/Views/Shared/_Layout.cshtml";
    var ls = ViewBag.ShopPerformanceList as IList<ShopPerformanceEntity>;
    var orderCountTotal = ls.Sum(x => x.OrderTotal);
    var orderAmountTotal = ls.Sum(x => x.OrderAmountTotal);
    var bonusFeeTotal = ls.Sum(x => x.BonusFee);
    var consignmentSaleFeeTotal = ls.Sum(x => x.ConsignmentSaleFee);
}
<style type="text/css">
    .shop-performance-list {
        width: 90%;
        margin: 0px auto;
        padding-bottom: 20px;
    }

    .shop-performance-list-table {
        width: 90%;
        border: 1px solid #dddddd;
        margin-top: 20px;
    }

    .shop-performance-list-sub-table {
        width: 90%;
        border: 1px solid #dddddd;
    }

        .shop-performance-list-sub-table td {
            font-size: 16px;
        }

    .shop-performance-list-table tr {
        border-bottom: 1px dashed #dddddd;
    }

        .shop-performance-list-table tr:last-child {
            border-bottom-style: none;
        }

    .shop-performance-list-table td {
        padding: 10px;
        font-size: 16px;
    }

    .lb-date {
        color: red;
    }

    .lb-statistics {
        color: red;
    }
</style>
<div class="shop-performance-list">
    <table align="center" class="shop-performance-list-table">
        <tr>
            <td align="right" class="lb-statistic" width="140">订单总计:</td>
            <td><label class="lb-statistics">@orderCountTotal</label></td>
        </tr>
        <tr>
            <td align="right">订单总金额:</td>
            <td><label class="lb-statistics">@orderAmountTotal</label></td>
        </tr>
        <tr>
            <td align="right">平台分红总计:</td>
            <td><label class="lb-statistics">@bonusFeeTotal</label></td>
        </tr>
        <tr>
            <td align="right">寄售服务费总计:</td>
            <td><label class="lb-statistics">@consignmentSaleFeeTotal</label></td>
        </tr>
    </table>
    @{
        foreach (var item in ls)
        {
            <table align="center" class="shop-performance-list-table">
                <tr>
                    <td align="right" width="100">日期:</td>
                    <td><label class="lb-date">@item.Date</label></td>
                </tr>
                <tr>
                    <td align="right">订单总数:</td>
                    <td><label>@item.OrderTotal</label></td>
                </tr>
                <tr>
                    <td align="right">订单总金额:</td>
                    <td><label>@item.OrderAmountTotal</label></td>
                </tr>
                <tr>
                    <td align="right">订单均价:</td>
                    <td><label>@item.OrderAmountAvg</label></td>
                </tr>
                <tr>
                    <td align="right">平台分红:</td>
                    <td><label>@item.BonusFee</label></td>
                </tr>
                <tr>
                    <td align="right">寄售服务费:</td>
                    <td><label>@item.ConsignmentSaleFee</label></td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <table align="center" class="shop-performance-list-sub-table">
                            <tr>
                                <td align="center" width="100">
                                    0 - 5K
                                </td>
                                <td>
                                    <button type="button"
                                            class="layui-btn layui-btn-sm fold-btn">
                                        <i class="layui-icon layui-icon-folder"></i>折叠/收缩
                                    </button>
                                </td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">0 - 1K</td>
                                <td><label>@item.AmountFrom0KTo1K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">1K - 2K</td>
                                <td><label>@item.AmountFrom1KTo2K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">2K - 3K</td>
                                <td><label>@item.AmountFrom2KTo3K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">3K - 4K</td>
                                <td><label>@item.AmountFrom3KTo4K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">4K - 5K</td>
                                <td><label>@item.AmountFrom4KTo5K</label></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <table align="center" class="shop-performance-list-sub-table">
                            <tr>
                                <td align="center" width="100">
                                    5K - 10K
                                </td>
                                <td>
                                    <button type="button"
                                            class="layui-btn layui-btn-sm fold-btn">
                                        <i class="layui-icon layui-icon-folder"></i>折叠/收缩
                                    </button>
                                </td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">5K - 6K</td>
                                <td><label>@item.AmountFrom5KTo6K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">6K - 7K</td>
                                <td><label>@item.AmountFrom6KTo7K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">7K - 8K</td>
                                <td><label>@item.AmountFrom7KTo8K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">8K - 9K</td>
                                <td><label>@item.AmountFrom8KTo9K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">9K - 10K</td>
                                <td><label>@item.AmountFrom9KTo10K</label></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <table align="center" class="shop-performance-list-sub-table">
                            <tr>
                                <td align="center" width="100">
                                    10K - 15K
                                </td>
                                <td>
                                    <button type="button"
                                            class="layui-btn layui-btn-sm fold-btn">
                                        <i class="layui-icon layui-icon-folder"></i>折叠/收缩
                                    </button>
                                </td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">10K - 11K</td>
                                <td><label>@item.AmountFrom10KTo11K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">11K - 12K</td>
                                <td><label>@item.AmountFrom11KTo12K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">12K - 13K</td>
                                <td><label>@item.AmountFrom12KTo13K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">13K - 14K</td>
                                <td><label>@item.AmountFrom13KTo14K</label></td>
                            </tr>
                            <tr style="display: none;">
                                <td align="right">14K - 15K</td>
                                <td><label>@item.AmountFrom14KTo15K</label></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        }
    }
</div>

<script type="text/javascript" src="~/Static/Js/shopmanage/shopperformance.js?rand=0"></script>